<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta charset="UTF-8">
	<title>修改抵扣卡</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="<c:url value='/jsp/muban/images/favicon.ico'/>" type="image/x-icon" />
    <link rel="stylesheet" href="<c:url value='/jsp/muban/css/font.css'/>">
	<link rel="stylesheet" href="<c:url value='/jsp/muban/css/xadmin.css'/>">
	<script type="text/javascript" src="<c:url value='/jsp/muban/js/jquery-min-1.7.js'/>"></script>
   <%--  <script type="text/javascript" src="<c:url value='/jsp/muban/js/jquery.min.js'/>"></script> --%>
  <%--   <script type="text/javascript" src="<c:url value='/jsp/lead_into/js/jquery-3.3.1.js'/>"></script> --%>
    <script type="text/javascript" src="<c:url value='/jsp/muban/js/xadmin.js'/>"></script>
    <script src="<c:url value='/jsp/muban/lib/layui/layui.js" charset="utf-8'/>"></script> 
    <link rel="stylesheet" href="<c:url value='/jsp/muban/lib/layui/css/layui.css'/>">
    <link rel="stylesheet" href="easyUpload/easy-upload.css" />
	<script type="text/javascript" src="easyUpload/vendor/jquery.cookie-1.4.1.min.js"></script>
	<script type="text/javascript" src="easyUpload/easyUpload.js"></script>
	<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
   	<script type="text/javascript" charset="utf-8" src="ueditor.all.js"> </script>
	<%-- <script src="<c:url value='/jsp/lead_into/yuanban_layui/layui/layui.js '/>"></script> --%>
	
	<script type="text/javascript">

    	$(function(){        
            /*input字数*/
            /*在页面刚载入时先显示出输入框的字数*/
            var text1=$("#detail1").val();
            var counter1=text1.length;
            $("#detail1_num").text(counter1);
            /*添加触发事件进行动态计算输入框的字数*/
            $("#detail1").on('blur keyup input',function(){
                var text=$("#detail1").val();
                var counter=text.length;
                $("#detail1_num").text(counter);
            });
            
            /* textarea字数*/
            var text2=$("#detail2").val();
            var counter2=text2.length;
            $("#detail2_num").text(counter2);
            $("#detail2").on('blur keyup input',function(){
                var text=$("#detail2").val();
                var counter=text.length;
                $("#detail2_num").text(counter);
            });
            
            /* textarea字数*/
            var text2=$("#detail3").val();
            var counter2=text2.length;
            $("#detail3_num").text(counter2);
            $("#detail3").on('blur keyup input',function(){
                var text=$("#detail3").val();
                var counter=text.length;
                $("#detail3_num").text(counter);
            });
    	/* }); */
    	
    	$("#sg_type").keyup(function (){
        	//alert("dianjile");
        	if ($("#sg_type").val()=="") {
        		console.log("为空了");
        		$("#sg_type").click();			
        		$("#sg_type").click();
			}
        })
        
       /*  var selectV = $("#fangshi").val();
        alert("你选择的是："+selectV); */
        $("#fangshi").change(function () {
        	var selectV = $("#fangshi").val();
          /* alert("你选择的是："+selectV); */ 
            if(selectV =='购买'){
            	/* alert("你选择的是："+selectV); */
            	//标签存在
            	if ($("#sg_yuyue").length>0 && $("#sg_price").length<=0) {
            		$("#sg_yuyue").remove();
            		$("#fangshiSE").append('<input class="form-control1"  id="sg_price" type="text" onkeyup="clearNoNum(this)" name="sg_price" placeholder="默认单位：元"  />');
				}else {
					$("#fangshiSE").append('<input class="form-control1" id="sg_price" type="text" onkeyup="clearNoNum(this)" name="sg_price" placeholder="默认单位：元"  />');
				}
            }
            if(selectV =='预约'){
            	/* alert("你选择的是："+selectV); */
            	//标签存在0
            	if ($("#sg_price").length>0 && $("#sg_yuyue").length<=0) {
            		$("#sg_price").remove();
            		$("#fangshiSE").append('<input class="form-control1" id="sg_yuyue" type="text" onkeyup="clearNoCN(this)" name="sg_appointment" placeholder="不填写默认:立即预约"  />');
				}else {
					$("#fangshiSE").append('<input class="form-control1" id="sg_yuyue" type="text" onkeyup="clearNoCN(this)" name="sg_appointment" placeholder="不填写默认:立即预约" />');
				}
            }
		})
	});

    	        
	</script>
	<style type="text/css">
		#fangshi{
			background-color: #FFFFFF;
    		border: 1px solid #E3E3E3;
   		 	border-radius: 4px;
    		color: #565656;
    		padding: 7px 12px;
    		height: 38px;
    		width:15%;
    		-webkit-box-shadow: none;
    		box-shadow: none;
    		-webkit-transition: all 300ms linear;
    		-moz-transition: all 300ms linear;
    		-o-transition: all 300ms linear;
    		-ms-transition: all 300ms linear;
    		transition: all 300ms linear;
		}
		.form-control1 {
    		background-color: #FFFFFF;
    		border: 1px solid #E3E3E3;
   		 	border-radius: 4px;
    		color: #565656;
    		padding: 7px 12px;
    		height: 38px;
    		width: 15%;
    		-webkit-box-shadow: none;
    		box-shadow: none;
    		-webkit-transition: all 300ms linear;
    		-moz-transition: all 300ms linear;
    		-o-transition: all 300ms linear;
    		-ms-transition: all 300ms linear;
    		transition: all 300ms linear;
		}
		.labelaa{
			 display: inline-block;
                width:100px;
		}
	<!-- </style>
<style type="text/css"> -->
	/*圆形头像  */
	/* #divcss5{ margin:10px auto}  */
	#divcss5 img{ border-radius:50%} 
	.x-so input.layui-input {
    	width: 150px;
	}
</style>
</head>
<body>
   
     <div class="x-body">
        <form id = "form1" action="updateSmallticket.do" method="post" class="layui-form">
          		<div class="am-form-group"></div>
          		<!-- <label>折扣卡标题</label> -->
   <input type="hidden" name="ct_id" value="${smallticketDetail['ct_id'] }">
    <div class="layui-form-item" >
    <label for="L_username" class="layui-form-label"><span class="x-red">*</span>折扣卡标题</label>
    <div class="layui-input-block">
			<input class="layui-input" id="detail1" type="text" maxlength="40" name="ct_name" value="${smallticketDetail['ct_name'] }"/>
          							<p>当前输入字数<span id="detail1_num">0</span>/<span>最大输入</span><span>40</span></p>
    </div>
  </div>
  
  <div class="layui-form-item" >
    <label for="L_username" class="layui-form-label"><span class="x-red">*</span>到期时间</label>
    <div class="layui-input-block">
		 <input type="text" class="layui-input" id="test1" name="ct_Invalidtime" value="${smallticketDetail['ct_Invalidtime'] }">
    </div>
  </div>
  
  <!-- <div class="layui-form-item" >
    <label for="L_username" class="layui-form-label"><span class="x-red">*</span>折扣卡视频</label>
    <div class="layui-input-block">
			<input class="layui-input" id="videourl" type="text" placeholder="（可不填写）请粘贴腾讯视频地址，其他格式地址无效！" onchange="checkVideo();" name="videourl"/>
          							
    </div>
  </div> -->
                
   
          	<!-- 	<label for="L_username" class="layui-form-label">
                  <span class="x-red">*</span>折扣卡标题
              </label>
          		<input class="layui-input" id="detail1" type="text" maxlength="18" name="a_title"/>
          							<p>当前输入字数<span id="detail1_num">0</span>/<span>最大输入</span><span>18</span></p> -->
          		<%-- <label>折扣卡类型</label><input id="sg_type" list="browsers" class="am-form-field am-radius" name="sg_type">
							<datalist id="browsers">
								<c:forEach items="${typeList}" var="aaa" varStatus="ccc">
										<option value="${aaa.sg_type}">
								</c:forEach>
							</datalist><br> --%>
				<input type="hidden" id="upload_SLT" value="">
		

   
 
  
  
  
  <div class="layui-form-item" >
    <label for="L_username" class="layui-form-label"><span class="x-red">*</span>折扣卡介绍</label>
    <div class="layui-input-block">
		<script id="editor"  type="text/plain" style="width:100%;height:500px;">${smallticketDetail['ct_info']}</script>
    </div>         		 
 </div>  
 
 <!-- <div class="layui-form-item" >
    <label for="L_username" class="layui-form-label"><span class="x-red">*</span>折扣卡流程</label>
    <div class="layui-input-block">
		<script id="editor1" name="editor1" type="text/plain" style="width:100%;height:500px;"></script>
    </div>         		 
 </div>        --> 
        <!--   		<label for="L_username" class="layui-form-label">
                  <span class="x-red">*</span>折扣卡描述
              </label>
          		<br>
          		<br>
          		ue初始化
          		<script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
          		
				<br> -->
<div class="layui-form-item" >
    <label for="L_username" class="layui-form-label"></label>
    <div class="layui-input-block">
				<input id="add" type="submit" class="layui-btn" onclick="return up();">
    </div>         		 
 </div> 				
          		
          	</form>
    </div>
  
		<!-- ue初始化 -->
		<script type="text/javascript">
			var ue = UE.getEditor('editor',{
				toolbars: [[
		    		'source','bold', 'italic',  'removeformat', 'formatmatch', 'autotypeset','selectall', 'cleardoc', 
		           'lineheight', '|','fontfamily', 'fontsize', 'forecolor', 'backcolor','|',
		            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|','insertimage', 'emotion', 'insertvideo'
		        ]]
		    });
		</script>
		
		
		
		<script type="text/javascript">
		
		
		//检测网页输入的值是否输入完毕
		function up() {
			
			/*  alert(a); */
			if($("#detail1").val()==''){
				alert("请输入折扣卡标题！");
				 return false; 
			}else if ($("#test1").val()=="") {
				alert("请输入到期时间！");
				 return false;
			}else {
				/* alert("jinlaile "); */
				//在这里哦进行
				
				
				$("#add").click();
				$("#add").attr("disabled",true);
				return true;
			}
		}
		
		
		
		</script>
      <script type="text/javascript">
      layui.use('laydate', function(){
    	  var laydate = layui.laydate;
    	  
    	  //执行一个laydate实例
    	  laydate.render({
    	    elem: '#test1' //指定元素
    	    	,type: 'datetime'
    	  });
    	});
      </script>
  </body>
</html>